﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;
using PersonaLibrary.Data;

namespace PersonaLibrary.Converters
{
	internal class EmployeeBirthdayConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			Employee employee = value as Employee;

			if(employee != null)
			{
				if (employee.Birthday.HasValue)
					return employee.Birthday.Value.ToShortDateString();

				return employee.InexactBirthday;
			}

			return null;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
